package edu.vt.sdm.tcga.datamining;

import edu.vt.sdm.tcga.View.HeatMapExample;

//Image data mining algorithm here.
public class WorkerThread implements Runnable {
    private static final int TIMER_INTERVAL = 1000;
	private HeatMapExample _hmView = null;
	
	public WorkerThread(HeatMapExample hmView) {
		_hmView = hmView;
	}

	public void go() {
		Thread t = new Thread(this);
		t.start();
	}
	
	@Override
	public void run() {
		int counter = 0;
		try {
			while (_hmView != null) {
				_hmView.updateLabelText("Counter = " + counter);
				counter++;
				Thread.sleep(TIMER_INTERVAL);
			}
		} catch(InterruptedException e) {
			e.printStackTrace();
		}
	}
}
